package loop;

public class Return {

    public static int[] t1(){
        int[] s = new int[2];
        for (int i=0;i<3;i++){
            if(i==2){
                s[0] = 9;
                s[1] = 8;

                //会直接方法返回
                return s;
            }
            System.out.println(i);
        }
        return s;
    }

    public static void t2(){
        int[] n = {1,2,3,3,3};
        int s = 0;
        for(int i=0;i<n.length;i++) {

            for(int j=0;j<n.length;j++) {
                if(j == 1) {
                    break;
                }
            }
            s++;
        }
        System.out.println(s);
    }

    public static void main(String[] args) {

        /* System.out.println(Arrays.toString(t1())); */
        t2();
    }
}
